import { StringIndexer } from "mmb";
import DeliveryMode from "../bg-enums/deliveryMode";
import StorageMode from "../bg-enums/storageMode";
import DataSource from "../bg-enums/dataSource";
import ActivityProcessStatus from "../bg-enums/activityProcessStatus";
import ActivitySaleMode from "../bg-enums/activitySaleMode";
import ActivityQualifyType from "../bg-enums/activityQualifyType";
import ActivityOwner from "../bg-enums/activityOwner";
import ActivityType from "../bg-enums/activityType";
import UserRole from "../bg-enums/userRole";
import ProxyApplyStatus from "../bg-enums/proxyApplyStatus";
import OrderType from "../bg-enums/orderType";
import OrderStatus from "../bg-enums/orderStatus";
import AfterSaleStatus from "../bg-enums/afterSaleStatus";
import GoodsReceivingStatus from "../bg-enums/goodsReceivingStatus";
import AfterSaleType from "../bg-enums/afterSaleType";
import UserStratification from "../bg-enums/userStratification";
import BrandEndorseApplyField from "../bg-enums/brandEndorseApplyField";
import BrandDistributionEndorseApplyField from "../bg-enums/brandDistributionEndorseApplyField";
import AfterSaleCloseReason from "../bg-enums/afterSaleCloseReason";
import WithdrawTarget from "../bg-enums/withdrawTarget";
import AuditResult from "../bg-enums/auditResult";
import AwardType from "../bg-enums/awardType";

/****************************************************************************************/
/*                                   shared                                             */
/****************************************************************************************/
export interface MiniItem {
  id: string;
  name: string;
}

export interface TimeRange {
  beginAt: string;
  endAt: string;
}

export interface Warehouse {
  id: string;
  tel: string;
  linkman: string;
  address: string;
  lng: string;
  lat: string;
  cityCode: string;
  deliveryModes: DeliveryMode[];
}

export interface AccountLogInfo {
  id: string;
  logged: number;
  category: string;
  amount: number;
  subject: string;
  ext_info: string;
}

export interface ProductGroup {
  productGroupId: string;
  brandId: string;
  sortNo: number;
  name: string;
  productCount: number;
}

export interface ExpressPlatformInfo {
  id: string;
  name: string;
}

export interface SearchObject {
  id: string;
  name: string;
}

export interface ProductWithDistributeInfo {
  productId: string;
  name: string;
  pics: string[];
  hasSpecs: boolean;
  priceMin: number;
  priceMax: number;
  productGroupId?: string;
  productAttributeDefs: ProductAttributeDef[];
  productSpecs: ProductSpec[];
  percentSale: number;
  percentOff: number;
}

export interface LogisticsInfo {
  platform: string;
  platformOrderNum: string;
}

export interface AwardInfo {
  type: AwardType;
  desc: string;
  prize?: number;
}

export interface CheckIn1 {
  awardOnceCoins: number;
  awardReachMaxCoins: number;
  continuous: number;
}

export interface Lottery1 {
  uiType: string;
  winRate: number;
  prizeRates: number[];
}

/****************************************************************************************/
/*                                   user                                               */
/****************************************************************************************/

export interface User {
  userId: string;
  openId: string;
  mobile?: string;
  memberToken?: string;
  memberTokenRefreshed?: number;
  pic?: string;
  nickName?: string;
  realName?: string;
  idCardNo?: string;
  intro?: string;
  homepageBg?: string;
  registered?: number;
  unionId?: string;
  roles: UserRole[];
}

export interface CreateUserParams {
  openId: string;
  nickName: string;
  registerPage: string;
  unionId: string;
}

export interface UpdateUserBaseParams {
  userId: string;
}

export interface UpdateInfoParams extends UpdateUserBaseParams {
  pic?: string;
  nickName?: string;
  intro?: string;
  homepageBg?: string;
}

export interface UpdateMobileParams extends UpdateUserBaseParams {
  mobile: string;
}

export interface UpdateMemberTokenParams extends UpdateUserBaseParams {
  memberToken: string;
}

/****************************************************************************************/
/*                                   userExt                                            */
/****************************************************************************************/

export interface UserExt {
  userId: string;
  shareUserId?: string;
  sex?: string;
  city?: string;
  province?: string;
  country?: string;
}

export interface UpsertExtParams extends UpdateUserBaseParams {
  userId: string;
  shareUserId?: string;
  sex?: string;
  city?: string;
  province?: string;
  country?: string;
}

/****************************************************************************************/
/*                                   userStat                                           */
/****************************************************************************************/

export interface UserStat {
  userId: string;
  fansCount?: number;
  followUserCount?: number;
  followBrandCount?: number;
  endorseBrandCount?: number;
  endorseActivityCount?: number;
  involveActivityCount?: number;
  orderCount?: number;
  viewCount?: number;
  payAmount?: number;
}

export interface UpsertStatParams extends UpdateUserBaseParams {
  fansCount?: number;
  followUserCount?: number;
  followBrandCount?: number;
  endorseBrandCount?: number;
  endorseActivityCount?: number;
  involveActivityCount?: number;
  orderCount?: number;
  viewCount?: number;
  payAmount?: number;
}

/****************************************************************************************/
/*                                   userAccount                                        */
/****************************************************************************************/

export interface UserAccount {
  userId: string;
  availableAmount: number;
  pendingAmount: number;
  withdrawedAmount: number;
}

/****************************************************************************************/
/*                                   user_account_withdraw_applyment                    */
/****************************************************************************************/

export interface UserAccountWithdrawApplyment {
  userAccountWithdrawApplymentId: string;
  userId: string;
  target: WithdrawTarget;
  applied: number;
  amount: number;
  remark: string;
  applyState: string;
}

export interface CreateUserWithdrawApplymentParams {
  userId: string;
  target: WithdrawTarget;
  amount: number;
  realName: string;
  idCardNo: string;
  remark: string;
}

/****************************************************************************************/
/*                                   user_account_log                                   */
/****************************************************************************************/
export interface AggrUserAccountLogsToInOutRet {
  income: number;
  outlay: number;
}

/****************************************************************************************/
/*                                   user joins                                         */
/****************************************************************************************/

export interface UserWithStat extends User {
  // user_stat
  fansCount?: number;
  followUserCount?: number;
  followBrandCount?: number;
  followStoreCount?: number;
  endorseBrandCount?: number;
  endorseStoreCount?: number;
  endorseActivityCount?: number;
  involveActivityCount?: number;
  orderCount?: number;
  viewCount?: number;
  payAmount?: number;
}

/****************************************************************************************/
/*                                   user_fan                                           */
/****************************************************************************************/

export interface UserFan {
  userFanId: string;
  userId: string;
  followerUserId: string;
  beFollowed?: number;
  aliasName: string;
  remark?: string;
}

export interface UpsertUserFanParams {
  userId: string;
  followerUserId: string;
  beFollowed: number;
  aliasName: string;
}

export interface UpdateUserFanParams {
  userFanId: string;
  aliasName: string;
  remark?: string;
}

export interface UserFanWithUserStat extends UserFan {
  // user_stat
  fansCount?: number;
  followUserCount?: number;
  followBrandCount?: number;
  endorseBrandCount?: number;
  endorseActivityCount?: number;
  involveActivityCount?: number;
  orderCount?: number;
  viewCount?: number;
  payAmount?: number;
  followerUserNickName?: string;
  followerUserPic?: string;
}

/****************************************************************************************/
/*                                   user_follow                                        */
/****************************************************************************************/

export interface UserFollow {
  userFollowId: string;
  userId: string;
  followedUserId: string;
  followed?: number;
  remark?: string;
}

export interface UpsertUserFollowParams {
  userId: string;
  followedUserId: string;
  followed: number;
}

export interface UpdateUserFollowParams {
  userFollowId: string;
  aliasName: string;
  remark?: string;
}

export interface UserFollowWithUserAndUserStat extends UserFollow {
  // user
  followedUserName: string;
  followedUserPic: string;
  // user_stat
  fansCount?: number;
  followUserCount?: number;
  followBrandCount?: number;
  endorseBrandCount?: number;
  endorseActivityCount?: number;
  involveActivityCount?: number;
  orderCount?: number;
  viewCount?: number;
  payAmount?: number;
}

/****************************************************************************************/
/*                                   user_pv_log                                        */
/****************************************************************************************/
export interface UserPvLog {
  userPvLogId: string;
  created: number;
  userId: string;
  brandId?: string;
  shareUserId?: string;
  page: string;
}

export interface CreateUserPvLogParams {
  userId: string;
  brandId?: string;
  shareUserId?: string;
  page: string;
}

export interface UpdateUserPvLogParams {
  userPvLogId: string;
  isCounted: boolean;
}

/****************************************************************************************/
/*                                   brand                                              */
/****************************************************************************************/

export interface Brand {
  brandId: string;
  name: string;
  intro?: string;
  pic?: string;
  homepageBg?: string;
  tel?: string;
  opened?: number;
  remotePK: string;
}

export interface BilinBrand {
  remotePkOfBrand: string;
  remotePkOfEmployee: string;
  name: string;
  logo: string;
  desc: string;
}

export interface BrandExt {
  brandExtId: string;
  brandId: string;
  ownUserId: string;
  webposToken: string;
  webposTokenRefreshed: number;
  isWxpayAvailable: boolean;
}

export interface BrandWithExt extends Brand {
  // brand_stat
  ownUserId: string;
}

export interface BrandWithStat extends Brand {
  // brand_stat
  fansCount?: number;
  adminCount?: number;
  publishActivityCount?: number;
  spokesmanCount?: number;
  endorseRequestToAuditCount?: number;
}

export interface BrandWithExtAndStat extends BrandWithStat {
  // brand_stat
  ownUserId: string;
  isWxpayAvailable: boolean;
  isDuringApplication: boolean;
}

export interface BrandWithExtAndStatAndEndorsement extends BrandWithExtAndStat {
  // distribugte
  isDistributionEntranceDisplay: boolean;
  distributorId: string;

  // endorsement
  isEndorsementEntranceDisplay: boolean;
  endorseSpokesmanId: string;
}

export interface ActivityAsFeatureAvailable {
  activityType: ActivityType;
  isAvailable: boolean;
}

export interface GetBrandWithExtAndStatAndEndorsementForUserRet {
  brandWithExtAndStatAndEndorsement: BrandWithExtAndStatAndEndorsement;
  activityAsFeatureAvailables: ActivityAsFeatureAvailable[];
}

export interface BrandEndorsement {
  brandId: string;
  isOpen: boolean;
  spokesmanTitle: string;
  userStratified: UserStratification;
  consumerLowerExpense?: number;
  needApplyInfo: boolean;
  applyInfoFields?: string[];
  isEntranceDisplay: boolean;
  isAutoApproved: boolean;
}

export interface BrandDistributeEndorsement {
  brandId: string;
  isOpen: boolean;
  distributorTitle: string;
  userStratified: UserStratification;
  consumerLowerExpense?: number;
  needApplyInfo: boolean;
  applyInfoFields?: BrandDistributionEndorseApplyField[];
  isEntranceDisplay: boolean;
  isAutoApproved: boolean;
}

export interface BrandDistributeSupplySetting {
  brandId: string;
  deliveryModes: DeliveryMode[];
  isUseWarehouseShippingFeeRule: boolean;
  unifiedShippingFee?: number;

  // warehouses
  warehouseIds: string[];
}

export interface BrandSettlementAccountInfo {
  brandId: string;
  availableAmount: number;
  pendingAmount: number;
  withdrawingAmount: number;
  withdrawedAmount: number;
  accountBank: string;
  accountNumberSuffix: string;
}

export interface OpenBrandParams {
  origin: DataSource;
  name: string;
  intro: string;
  pic: string;
  remotePK: string;
  userId: string;
}

export interface OpenNewParams {
  name: string;
  intro: string;
  pic: string;
  remotePkOfBrand?: string;
  remotePkOfEmployee?: string;
  userId: string;
}

export interface UpdateBrandParams {
  brandId: string;
  intro?: string;
  pic?: string;
  homepageBg?: string;
  tel?: string;
}

export interface UpsertBrandEndorsementParams {
  brandId: string;
  isOpen: boolean;
  spokesmanTitle: string;
  userStratified: UserStratification;
  consumerLowerExpense?: number;
  needApplyInfo: boolean;
  applyInfoFields?: BrandEndorseApplyField[];
  isEntranceDisplay: boolean;
  isAutoApproved: boolean;
}

export interface UpsertBrandDistributeEndorsementParams {
  brandId: string;
  isOpen: boolean;
  distributorTitle: string;
  userStratified: UserStratification;
  consumerLowerExpense?: number;
  needApplyInfo: boolean;
  applyInfoFields?: BrandDistributionEndorseApplyField[];
  isEntranceDisplay: boolean;
  isAutoApproved: boolean;
}

export interface UpsertBrandDistributeSupplySettingParams {
  brandId: string;
  deliveryModes: DeliveryMode[];
  isUseWarehouseShippingFeeRule: boolean;
  unifiedShippingFee?: number;

  // warehouses
  warehouseIds: string[];
}

export interface UpsertBrandDistributeProductParams {
  brandId: string;
  productId: string;
  percentSale: number;
  percentOff: number;
}

export interface BatchUpsertBrandDistributeProductsParams {
  brandId: string;
  percentSale: number;
  percentOff: number;
}

export interface RefreshWebposTokenParams {
  brandExtId: string;
  webposToken: string;
  webposTokenRefreshed: number;
}

/****************************************************************************************/
/*                                   brand_account_withdraw_applyment                   */
/****************************************************************************************/

export interface BrandAccountWithdrawApplyment {
  brandAccountWithdrawApplymentId: string;
  brandId: string;
  userId: string;
  applied: number;
  amount: number;
  remark?: string;
  applyState: string;
}

export interface CreateAccountWithdrawApplymentParams {
  brandId: string;
  userId: string;
  amount: number;
  remark?: string;
}

/****************************************************************************************/
/*                                   brand_account_log                                  */
/****************************************************************************************/

export interface AggrBrandAccountLogsToInOutRet {
  income: number;
  outlay: number;
}

/****************************************************************************************/
/*                                   brand_fan                                          */
/****************************************************************************************/

export interface BrandFan {
  brandFanId: string;
  brandId: string;
  followerUserId: string;
  beFollowed?: number;
  aliasName: string;
  remark?: string;
}

export interface UpsertBrandFanParams {
  brandId: string;
  followerUserId: string;
  beFollowed: number;
  aliasName: string;
}

export interface UpdateBrandFanParams {
  brandFanId: string;
  aliasName: string;
  remark?: string;
}

export interface BrandFanWithUserAndUserStat extends BrandFan {
  // user
  followerUserNickName: string;
  followerUserPic: string;

  // user_stat
  fansCount?: number;
  followUserCount?: number;
  followBrandCount?: number;
  followStoreCount?: number;
  endorseBrandCount?: number;
  endorseStoreCount?: number;
  endorseActivityCount?: number;
  involveActivityCount?: number;
  orderCount?: number;
  viewCount?: number;
  payAmount?: number;
}

/****************************************************************************************/
/*                                   brand_follow                                       */
/****************************************************************************************/

export interface BrandFollow {
  brandFollowId: string;
  userId: string;
  followedBrandId: string;
  followed?: number;
  remark?: string;
}

export interface UpsertBrandFollowParams {
  userId: string;
  followedBrandId: string;
  followed: number;
}

export interface UpdateBrandFollowParams {
  brandFollowId: string;
  aliasName: string;
  remark?: string;
}

export interface BrandFollowWithBrandAndBrandStat extends BrandFollow {
  // brand
  followedBrandName: string;
  followedBrandPic: string;
  // brand_stat
  fansCount?: number;
  adminCount?: number;
  publishActivityCount?: number;
  spokesmanCount?: number;
  endorseRequestToAuditCount?: number;
}

/****************************************************************************************/
/*                                   brand_bank_card                                    */
/****************************************************************************************/

export interface BrandBankCard {
  brandBankCardId: string;
  brandId: string;
  userId: string;
  accountType: string;
  accountBank: string;
  bankAddressCode: string;
  bankName: string;
  accountNumber: string;
  verifyResult: string;
}

export interface UpsertBrandBankCardParams {
  brandId: string;
  userId: string;
  accountType: string;
  accountBank: string;
  bankAddressCode: string;
  bankName: string;
  accountNumber: string;
}

/****************************************************************************************/
/*                                   brand_admin                                        */
/****************************************************************************************/

export interface BrandAdmin {
  brandAdminId: string;
  userId: string;
  brandId: string;
  aliasName: string;
  became: number;
  remark: string;
}

export interface BecomeBrandAdminParams {
  userId: string;
  brandId: string;
  aliasName: string;
  became: number;
}

export interface UpdateBrandAdminParams {
  brandAdminId: string;
  aliasName?: string;
  remark?: string;
}

export interface CancelBrandAdminParams {
  brandAdminId: string;
}

export interface BrandAdminWithBrandOwnFlagByBrandIDAndUserID
  extends BrandAdmin {
  // additional
  isBrandOwner: boolean;
}

export interface BrandAdminWithUser extends BrandAdmin {
  // user
  userNickName: string;
  userPic: string;
}

/****************************************************************************************/
/*                                   brand_distribute_request                           */
/****************************************************************************************/

export interface BrandDistributeRequest {
  brandDistributeRequestId: string;
  brandId: string;
  userId: string;
  requested: number;
  audited?: number;
  applyFields: string;
  auditResult: AuditResult;
}

export interface BrandDistributeRequestWithUserInfo
  extends BrandDistributeRequest {
  userPic: string;
}

export interface ApplyBrandDistributeRequestParams {
  brandId: string;
  userId: string;
  applyFields: string;
}

export interface AuditBrandDistributeRequestParams {
  brandDistributeRequestId: string;
  audited: number;
  auditResult: AuditResult;
}

/****************************************************************************************/
/*                                   brand_distributor                                    */
/****************************************************************************************/
export interface BrandDistributor {
  brandDistributorId: string;
  userId: string;
  brandId: string;
  aliasName: string;
  became: number;
  remark?: string;
  distributeActivityCount: number;
  saleAmount: number;
}

export interface BecomeBrandDistributorParams {
  userId: string;
  brandId: string;
  aliasName: string;
  became: number;
}

export interface UpdateBrandDistributorParams {
  brandDistributorId: string;
  aliasName?: string;
  remark?: string;
}

export interface CancelBrandDistributorParams {
  brandDistributorId: string;
}

export interface BrandDistributorCacheInfo {
  userId: string;
  brandId: string;
}

export interface BrandDistributorWithBrand extends BrandDistributor {
  // brand
  brandName: string;
  brandPic?: string;
}

export interface BrandDistributorWithUser extends BrandDistributor {
  // brand
  distributorUserNickName: string;
  distributorUserPic?: string;
  fansCount: number;
}

/****************************************************************************************/
/*                                   brand_endorse_request                              */
/****************************************************************************************/

export interface BrandEndorseRequest {
  brandEndorseRequestId: string;
  brandId: string;
  userId: string;
  requested: number;
  audited?: number;
  applyFields: string;
  auditResult: AuditResult;
}

export interface BrandEndorseRequestWithUserInfo extends BrandEndorseRequest {
  userPic: string;
}

export interface ApplyBrandEndorseRequestParams {
  brandId: string;
  userId: string;
  applyFields: string;
}

export interface AuditBrandEndorseRequestParams {
  brandEndorseRequestId: string;
  audited: number;
  auditResult: AuditResult;
}

/****************************************************************************************/
/*                                   brand_spokesman                                    */
/****************************************************************************************/
export interface BrandSpokesman {
  brandSpokesmanId: string;
  userId: string;
  brandId: string;
  aliasName: string;
  became: number;
  remark?: string;
  endorseActivityCount: number;
  saleAmount: number;
}

export interface BecomeBrandSpokesmanParams {
  userId: string;
  brandId: string;
  aliasName: string;
  became: number;
}

export interface UpdateBrandSpokesmanParams {
  brandSpokesmanId: string;
  aliasName?: string;
  remark?: string;
}

export interface CancelBrandSpokesmanParams {
  brandSpokesmanId: string;
}

export interface BrandSpokesmanCacheInfo {
  userId: string;
  brandId: string;
}

export interface BrandSpokesmanWithBrand extends BrandSpokesman {
  // brand
  brandName: string;
  brandPic?: string;
  brandFansCount: number;
  brandPublishActivityCount: number;
}

export interface BrandSpokesmanWithUser extends BrandSpokesman {
  // brand
  spokesmanUserNickName: string;
  spokesmanUserPic?: string;
  fansCount: number;
}

/****************************************************************************************/
/*                                   brand_warehouse                                    */
/****************************************************************************************/

export interface BrandWarehouse {
  brandWarehouseId: string;
  brandId: string;
  name: string;
  tel: string;
  linkman: string;
  address: string;
  lng: string;
  lat: string;
  deliveryModes: DeliveryMode[];
  cityCode: string;
  deadline: string;
  storageMode: StorageMode;
  storeId: string;
  pStoreId: string;
  permissionId: string;
  remotePK: string;
}

export interface CreateBrandWarehouseParams {
  brandId: string;
  name: string;
  tel: string;
  linkman: string;
  address: string;
  lng: string;
  lat: string;
  deliveryModes: DeliveryMode[];
  // cityCode: string;
  // regionCode: string;
  // deadline: string;
  // storageMode: StorageMode;
  // storeId: string;
  // pStoreId: string;
  // permissionId: string;
}

export interface UpdateBrandWarehouseParams {
  brandWarehouseId: string;
  name: string;
  tel: string;
  linkman: string;
  address: string;
  lng: string;
  lat: string;
  deliveryModes: DeliveryMode[];
  // cityCode: string;
  // regionCode: string;
  // deadline: string;
  // storageMode: StorageMode;
  // storeId: string;
  // pStoreId: string;
  // permissionId: string;
}

/****************************************************************************************/
/*                                   product                                            */
/****************************************************************************************/
export interface ProductAttributeDef {
  key: string;
  values: string[];
}

export interface ProductAttributeDefExt extends ProductAttributeDef {
  remotePK: string;
  remoteData?: StringIndexer;
}

export interface ProductAttribute {
  key: string;
  value: string;
}

export interface ProductSpec {
  productSpecId: string;
  productAttributes: ProductAttribute[];
  name: string;
  price: number;
  remotePK?: string;
  remoteData?: StringIndexer;
}

export interface Product {
  productId: string;
  brandId: string;
  name: string;
  pics: string[];
  intro?: string;
  introPics: string[];
  hasSpecs: boolean;
  priceMin: number;
  priceMax: number;
  productGroupId?: string;
  // remotePrdTypeId: string;
  remotePK: string;
  productAttributeDefs: ProductAttributeDef[];
  productSpecs: ProductSpec[];
}

export interface CreateProductParams {
  brandId: string;
  name: string;
  price?: number;
  pics: string[];
  intro?: string;
  introPics: string[];
  productGroupId?: string;
  productAttributeDefs: ProductAttributeDefExt[];
  productSpecs: ProductSpec[];
}

export interface UpdateProductParams {
  productId: string;
  brandId: string;
  name: string;
  price?: number;
  pics: string[];
  intro?: string;
  introPics: string[];
  productGroupId?: string;
  productAttributeDefs: ProductAttributeDefExt[];
  productSpecs: ProductSpec[];
}

/****************************************************************************************/
/*                                   activity                                           */
/****************************************************************************************/

export enum ActivityIntroItemType {
  TEXT = "text",
  PIC = "pic",
  PIC_LIST = "pic_list",
  VIDEO = "video",
}

export interface ActivityIntroItem {
  type: ActivityIntroItemType;
  resource: string;
}

export interface ActivitySku {
  activitySkuId: string;
  productId: string;
  productSpecId?: string;
  price: number;
  maximum: number;
  freezeQuantity: number;
  soldedQuantity: number;
  storageKey: string;
  // product or product_spec info
  skuName: string;
}

export interface ActivityProductWithSku {
  activityProductId: string;
  productId: string;
  priceMin: number;
  priceMax: number;
  quantity: number;
  isShow: boolean;
  skus: ActivitySku[];

  // product info
  productName: string;
  productPics: string[];
}

export interface ActivityProductWithAttributeDefAndSku
  extends ActivityProductWithSku {
  productAttributeDefs: ProductAttributeDef[];

  // product info ext
  productIntro: string;
  productIntroPics: string[];
}

export interface ActivityConsignmentBonusSetting {
  productId: string;
  bonusRate: number;
}

export interface ActivityConsignment {
  allowHiddenProduct: boolean;
  allowAllSpokesman: boolean;
  specificSpokesmanIds?: string[];
  consignmentBonusSettings?: ActivityConsignmentBonusSetting[];
}

interface ActivityExtOfB {
  type: ActivityType;
  name: string;
  intro: ActivityIntroItem[];
  begined: number;
  ended: number;
  timeRanges?: TimeRange[];
  background?: string;
  saleMode: ActivitySaleMode;
  deliveryModes: DeliveryMode[];
  isUseWarehouseShippingFeeRule: boolean;
  unifiedShippingFee?: number;
  maxiumPurchaseFrequency?: number;
  minimumPurchaseAmount: number;
  tel: string;

  // warehouses
  warehouseIds: string[];

  // productWithSkus
  activityProductWithSkus: ActivityProductWithSku[];

  // consignment
  consignment?: ActivityConsignment;

  checkIn1?: CheckIn1;
  lottery1?: Lottery1;
}

interface ActivityExtOfStore {
  type: ActivityType;
  name: string;
  intro: ActivityIntroItem[];
  begined: number;
  ended: number;
  timeRanges?: TimeRange[];
  background?: string;
  saleMode: ActivitySaleMode;
  maxiumPurchaseFrequency?: number;
  minimumPurchaseAmount: number;
  tel: string;

  // productWithSkus
  activityProductWithSkus: ActivityProductWithSku[];

  // consignment
  consignment?: ActivityConsignment;
}

export interface ActivityOfB extends ActivityExtOfB {
  activityId: string;
  brandId: string;
  pubUserId: string;
  processStatus: ActivityProcessStatus;
  published?: number;
  poster?: string;
  verifyQualification: boolean;
  qualifyTypes: ActivityQualifyType[];
  owner: ActivityOwner;
  inventoryFreezeNo?: string;
}

export interface ActivityOfStore extends ActivityExtOfStore {
  activityId: string;
  brandId: string;
  storeId: string;
  distributorId: string;
  pubUserId: string;
  processStatus: ActivityProcessStatus;
  published?: number;
  poster?: string;
  verifyQualification: boolean;
  qualifyTypes: ActivityQualifyType[];
  owner: ActivityOwner;
  inventoryFreezeNo?: string;
}

interface ActivityItemWithStat {
  // activity
  activityId: string;
  brandId: string;
  pubUserId: string;
  name: string;
  type: ActivityType;
  intro: ActivityIntroItem[];
  processStatus: ActivityProcessStatus;
  published?: number;
  begined: number;
  ended: number;
  timeRanges?: TimeRange[];
  // activity_stat
  orderCount?: number;
  latestAccessed?: number;
  pv?: number;
  uv?: number;
  iv?: number;
}

export interface ActivityItemOfBWithStat extends ActivityItemWithStat {
  modified: number;
  saleMode: ActivitySaleMode;
}

export interface ActivityItemOfStoreWithStat extends ActivityItemWithStat {
  modified: number;
  storeId: string;
  distributorId: string;
  saleMode: ActivitySaleMode;
}

export interface ActivityItemOfSWithStat extends ActivityItemWithStat {
  modified: number;
  spokesmanId: string;
}

export interface ActivityItemOfU2BWithStatAndBrandInfo
  extends ActivityItemWithStat {
  saleMode: ActivitySaleMode;
  endorseSpokesmanId: string;
  endorsedActivityIds: string[];

  // brand info
  brandName: string;
  brandPic?: string;
}

export interface ActivityItemOfU2CWithStatAndOwnerInfo
  extends ActivityItemWithStat {
  spokesmanId?: string;
  // owner info
  owner: string;
  ownerName: string;
  ownerPic?: string;

  // permission
  // canManage: boolean;
  // endorseSpokesmanId?: string;
  // openEndorseToUser: boolean;
  // hasNotEndorsed: boolean;
  // isEndorsementEntranceDisplay: boolean;
}

export interface CreateActivityOfBParams extends ActivityExtOfB {
  brandId: string;
  pubUserId: string;
}

export interface CreateActivityOfStoreParams extends ActivityExtOfStore {
  storeId: string;
  pubUserId: string;
}

export interface UpdateActivityOfBParams extends ActivityExtOfB {
  activityId: string;
}

export interface UpdateActivityOfStoreParams extends ActivityExtOfStore {
  activityId: string;
  storeId: string;
}

export interface PublishActivityOfBParams {
  activityId: string;
  userId: string;
}

export interface PublishActivityOfStoreParams {
  activityId: string;
  userId: string;
  storeId: string;
}

export interface UpdateActivityOfBProcessStatusParams {
  activityId: string;
  brandId: string;
}

export interface UpdateActivityOfStoreProcessStatusParams {
  activityId: string;
  storeId: string;
}

interface ActivityExtOfS {
  name: string;
  intro: ActivityIntroItem[];
  timeRanges?: TimeRange[];
  background?: string;
  tel: string;
}

export interface ActivityOfS extends ActivityExtOfS {
  activityId: string;
  brandId: string;
  pubUserId: string;
  processStatus: ActivityProcessStatus;
  published?: number;
  type: ActivityType;
  begined: number;
  ended: number;
  poster?: string;
  saleMode: ActivitySaleMode;
  verifyQualification: boolean;
  qualifyTypes: ActivityQualifyType[];
  deliveryModes: DeliveryMode[];
  spokesmanId: string;
  maxiumPurchaseFrequency?: number;
  minimumPurchaseAmount: number;
  owner: ActivityOwner;
  rootId: string;
  parentId: string;
  // productWithSkus
  activityProductWithSkus: ActivityProductWithSku[];

  // consignment
  // consignment: ActivityConsignment;
}

export interface ActivityProductIsShow {
  productId: string;
  isShow: boolean;
}

export interface CreateActivityOfSParams extends ActivityExtOfS {
  parentId: string;
  spokesmanId: string;
  pubUserId: string;
  activityProductIsShows: ActivityProductIsShow[];
}

export interface UpdateActivityOfSParams extends ActivityExtOfS {
  activityId: string;
  activityProductIsShows: ActivityProductIsShow[];
}

export interface GetActivityOfSByParentIDAndSpokesmanIDParams {
  parentId: string;
  spokesmanId: string;
}
export interface UpdateActivityOfSProcessStatusParams {
  activityId: string;
  userId: string;
}

export interface PublishActivityOfSParams {
  activityId: string;
  userId: string;
}

export interface ActivityOfU2CWithStatAndOwnerInfo {
  activityId: string;
  brandId: string;
  storeId?: string;
  distributorId?: string;
  pubUserId: string;
  name: string;
  type: ActivityType;
  intro: ActivityIntroItem[];
  processStatus: ActivityProcessStatus;
  published?: number;
  begined: number;
  ended: number;
  timeRanges?: TimeRange[];
  background?: string;
  poster?: string;
  saleMode: ActivitySaleMode;
  verifyQualification: boolean;
  qualifyTypes: ActivityQualifyType[];
  deliveryModes: DeliveryMode[];
  isUseWarehouseShippingFeeRule: boolean;
  unifiedShippingFee?: number;
  spokesmanId: string;
  minimumPurchaseAmount: number;
  tel: string;
  owner: ActivityOwner;
  ownerName: string;
  ownerPic?: string;

  // activity_stat
  orderCount?: number;
  latestAccessed?: number;
  pv?: number;
  uv?: number;
  iv?: number;

  // warehouses
  warehouses: Warehouse[];
  // productWithAttributeDefAndSkus
  activityProductWithAttributeDefAndSkus: ActivityProductWithAttributeDefAndSku[];
  // brand
  isWxpayAvailable: boolean;
  // permission

  openEndorseToUser: boolean;
  hasNotEndorsed: boolean;
  isEndorsementEntranceDisplay: boolean;
  endorseSpokesmanId?: string;
  isDistributionEntranceDisplay: boolean;
  distributeDistributorId?: string;
}

export interface GetActivityOfU2CWithStatAndOwnerInfoForUserParams {
  activityId: string;
  userId: string;
}

/****************************************************************************************/
/*                                   activity_user_award                                */
/****************************************************************************************/

export interface RealPrizeSku {
  productId: string;
  productSpecId: string;
  storageKey: string;
  price: number;
  skuName: string;
}

export interface RealPrizeProduct {
  productId: string;
  productName: string;
  productPics: string[];
  priceMin: number;
  priceMax: number;
  quantity: number;
  productAttributeDefs: ProductAttributeDef[];
  skus: RealPrizeSku[];
}
export interface ActivityUserAwardForC {
  awardId: string;
  brandId: string;
  activityId: string;
  userId: string;
  awarded: number;
  needRedeemByMannual: boolean;
  redeemDeadlineAt: number;
  isRedeemed: boolean;
  redeemed?: number;
  orderSerialNumber?: string;
  orderPaymentDeadlineAt?: number;
  awardType: AwardType;
  brandName: string;
  brandTel: string;
  activityName: string;
  activityType: ActivityType;
  activityTel: string;
  winnerNickName: string;
  winnerPic: string;
  winnerTel: string;
  bCoins: number;
  realPrizeProducts: RealPrizeProduct[];
  warehouseId?: string;
  deliveryModes?: DeliveryMode[];
  shippingFee?: number;
}

export interface ActivityAwardAsReporter {
  userNickName: string;
  desc: string;
  awarded: number;
}

/****************************************************************************************/
/*                                   activity_user_procedure                            */
/****************************************************************************************/
export interface DoCheckIn1Param {
  activityId: string;
  userId: string;
  userOpenId: string;
  authorizeNextRemind: boolean;
}

export interface DoLottery1Param {
  activityId: string;
  userId: string;
  userOpenId: string;
}

export interface DoLottery1Ret {
  awardInfos: AwardInfo[];
  procedure: Lottery1Procedure;
}

export interface Prize {
  productId: string;
  productName: string;
  productPics: string[];
  quantity: number;
}

export interface CheckIn1Def {
  activityId: string;
  brandId: string;
  name: string;
  type: ActivityType;
  intro: ActivityIntroItem[];
  background: string;
  poster?: string;
  tel: string;
  brandName: string;
  brandPic: string;
  prizes: Prize[];
  typeInfo: CheckIn1;
  isAvailable: boolean;
}

export interface CheckIn1Procedure {
  isCheckInToday: boolean;
  isContinuous: boolean;
  continuousCheckInCount: number;
  bCoins: number;
}

export interface CheckIn1Stat {
  latestAccessed?: number;
  pv: number;
  uv: number;
  iv: number;
}

export interface GetCheckIn1Ret {
  def: CheckIn1Def;
  procedure: CheckIn1Procedure;
  stat: CheckIn1Stat;
}

export interface ActivityNeedTypeInfo {
  activityId: string;
  brandId: string;
  name: string;
  type: ActivityType;
  intro: ActivityIntroItem[];
  processStatus: ActivityProcessStatus;
  published?: number;
  begined: number;
  ended: number;
  timeRanges?: TimeRange[];
  background: string;
  poster?: string;
  tel: string;
  brandName: string;
  brandPic: string;
  prizes: Prize[];
  // one of
  typeInfo: CheckIn1 | Lottery1;
}

export interface Lottery1Procedure {
  availableCount: number;
  drawedCount: number;
}

export interface GetLottery1Ret {
  def: ActivityNeedTypeInfo;
  procedure: Lottery1Procedure;
}

/****************************************************************************************/
/*                                   activity_user_pv_log                               */
/****************************************************************************************/
export interface CreateActivityUserPvLogParams {
  userId: string;
  activityId: string;
  shareUserId?: string;
  page: string;
}

/****************************************************************************************/
/*                                   activity_stat                                      */
/****************************************************************************************/

export interface AggrActivityExposureStat {
  pv: number;
  uv: number;
  iv: number;
}

export interface AggrActivityOrderStat {
  buyerCount: number;
  orderCount: number;
  orderAmount: number;
  distributeAmount: number;
  orderBonus: number;
  fee: number;
  wxpayCommission: number;
  platformCommission: number;
  refundBuyerCount: number;
  refundOrderCount: number;
  refundOrderAmount: number;
  refundDistributeAmount: number;
  refundOrderBonus: number;
  refundFee: number;
  refundWxpayCommission: number;
  refundPlatformCommission: number;
}

export interface AggrActivityStatsOfBrandRet {
  exposure: {
    own: AggrActivityExposureStat;
    endorsement: AggrActivityExposureStat;
  };
  order: {
    own: AggrActivityOrderStat;
    endorsement: AggrActivityOrderStat;
  };
}

export interface AggrActivityStatsOfSpokesmanRet {
  exposure: AggrActivityExposureStat;
  order: AggrActivityOrderStat;
}

export interface AggrActivityConsignment {
  spokesmanCount: number;
  consignmentAmount: number;
}

export interface RankActivityItemOfStoreForDistributorWithStatsOverOrderAmount {
  activityId: string;
  name: string;
  orderAmount: number;
  orderCount: number;
}

export interface AggrActivityConsignmentForSpokesman {
  orderCount: number;
  orderAmount: number;
  orderBonus: number;
  spokesmanId: string;
  spokesmanUserId: string;
  published: number;
  spokesmanUserNickName: string;
  spokesmanUserPic: string;
  spokesmanUserMobile: string;
}

export interface RankOverOrderAmountForSpokesman {
  orderAmount: number;
  refundOrderAmount: number;
  orderBonus: number;
  orderAmountRank: number;
  spokesmanId: string;
  spokesmanUserId: string;
  spokesmanUserNickName: string;
}

/****************************************************************************************/
/*                                   wxpay_applyment                                    */
/****************************************************************************************/
export interface BizLicenseInfo {
  // 证件扫描件 - MediaID
  businessLicenseCopy: string;
  // 证件注册号
  businessLicenseNumber: string;
  // 商户名称
  merchantName: string;
  // 经营者/法定代表人姓名
  legalPerson: string;
  // 注册地址
  companyAddress?: string;
  // 营业期限
  businessTime?: string;

  // 证件照片url (返回值有)
  copyUrl?: string;
}

export interface OrganizationCertInfo {
  // 组织机构代码证照片
  organizationCopy: string;
  // 组织机构代码
  organizationNumber: string;
  // 组织机构代码有效期限
  organizationTime: string;

  // 照片url (返回值有)
  copyUrl?: string;
}

export interface IDCardInfo {
  // 身份证人像面照片
  idCardCopy: string;
  // 身份证国徽面照片
  idCardNational: string;
  // 身份证姓名
  idCardName: string;
  // 身份证号码
  idCardNumber: string;
  // 身份证有效期限
  idCardValidTime: string;

  // 身份证人像面照片url (返回值有)
  cardUrl?: string;

  // 身份证国徽面照片url (返回值有)
  nationalUrl?: string;
}

export interface IDDocInfo {
  // 证件姓名
  idDocName: string;
  // 证件号码
  idDocNumber: string;
  // 证件照片
  idDocCopy: string;
  // 证件结束日期
  docPeriodEnd: string;
  // 证件照片url (返回值有)
  copyUrl?: string;
}

export interface AccountInfo {
  // 账户类型
  bankAccountType: string; // 小微/个人卖家:75-对私账户; 企业:74-对公账户 个体工商户:74-对公账户、75-对私账户
  // 开户银行
  accountBank: string;
  // 开户名称
  accountName: string;
  // 开户银行省市编码
  bankAddressCode: string;
  // 开户银行联行号
  bankBranchId?: string;
  // 开户银行全称 （含支行）
  bankName?: string;
  // 银行帐号
  accountNumber: string;
}

export interface ContactInfo {
  // 超级管理员类型
  contactType: string; // 小微/个人卖家:65; 企业:65-经营者/法人、66- 负责人;个体工商户:65-经营者/法人、66- 负责人
  // 超级管理员姓名
  contactName: string;
  // 超级管理员身份证件号码
  contactIdCardNumber: string;
  // 超级管理员手机
  mobilePhone: string;
  // 超级管理员邮箱
  contactEmail?: string;
}

export interface SalesSceneInfo {
  // 店铺名称
  storeName: string;
  // 店铺链接
  storeUrl?: string;
  // 店铺二维码
  storeQrCode?: string;
  // 小程序AppID
  miniProgramSubAppid?: string;
}

export interface AccountValidation {
  // 付款户名
  accountName: string;
  // 付款卡号
  accountNo: string;
  // 汇款金额 （以分为单位）
  payAmount: string;
  // 收款卡号
  destinationAccountNumber: string;
  // 收款户名
  destinationAccountName: string;
  // 开户银行
  destinationAccountBank: string;
  // 省市信息
  city: string;
  // 备注信息
  remark: string;
  // 汇款截止时间
  deadline: string;
}

export interface AuditDetail {
  // 参数名称
  paramName: string;
  // 驳回原因
  rejectReason: string;
}

export interface WxpayApplyFormData {
  // 申请类型
  applyType: string; // ecommerce/apply4sub
  // 商户号
  mchId: string;
  // 主体类型
  organizationType: string; // 2401~小微商户,2~企业 4~个体工商户
  // 营业执照/登记证书信息
  bizLicenseInfo?: BizLicenseInfo;
  // 组织机构代码证信息
  organizationCertInfo?: OrganizationCertInfo;
  // 经营者/法人证件类型
  idDocType?: string;
  // 经营者/法人身份证信息
  idCardInfo?: IDCardInfo;
  // 经营者/法人其他类型证件信息
  idDocInfo?: IDDocInfo;
  // 是否填写结算银行账户
  needAccountInfo: boolean;
  // 结算银行账户
  accountInfo?: AccountInfo;
  // 超级管理员信息
  contactInfo: ContactInfo;
  // 店铺信息
  salesSceneInfo: SalesSceneInfo;
  // 商户简称
  merchantShortname: string;
  // 特殊资质
  qualifications?: string[];
  // 特殊资质-query之后才有
  qualificationsUrl?: string[];
  // 补充材料
  businessAdditionPics?: string[];
  // 补充材料-query之后才有
  businessAdditionPicsUrl?: string[];
  // 补充说明
  businessAdditionDesc?: string;
}

export interface WxpayApplyment {
  wxpayApplymentId: string;
  brandId: string;
  wxpayMchIdAsService: string;
  proxyApplyStatus: ProxyApplyStatus;
  applyFormData: WxpayApplyFormData;
  applyNo?: string;
  wxApplymentId?: string;
  applyState?: string;
  applyStateDesc?: string;
  signUrl?: string;
  accountValidation?: AccountValidation;
  wxpayMchIdAsSub?: string;
  auditDetails?: AuditDetail[];
  legalValidationUrl?: string;
}

export interface UpsertWxpayApplymentParams {
  brandId: string;
  applyFormData: WxpayApplyFormData;
}

export interface UpsertWxpayApplymentRet {
  wxpayApplyment: WxpayApplyment;
  sgId: string;
}

export interface UpdateWxpayApplymentApplyNoParams {
  wxpayApplymentId: string;
  applyNo: string;
}

export interface UpdateWxpayApplymentProxyResultParams {
  wxpayApplymentId: string;
  wxApplymentId?: string;
  applyState?: string;
  applyStateDesc?: string;
  signUrl?: string;
  accountValidation?: AccountValidation;
  wxpayMchIdAsSub?: string;
  auditDetails?: AuditDetail[];
  legalValidationUrl?: string;
  applyFormData: WxpayApplyFormData;
}

/****************************************************************************************/
/*                                   order                                              */
/****************************************************************************************/

export interface OrderDetailItem {
  orderDetailId: string;
  productId: string;
  productName: string;
  productSpecId: string;
  productSpecKey: string;
  productSpecName: string;
  productWithSpecName: string;
  storageKey: string;
  productPics: string[];
  quantity: number;
  price: number;
}

interface OrderExt {
  orderId: string;
  ordered: number;
  serialNumber: string;
  brandId: string;
  activityId: string;
  orderType: OrderType;
  orderStatus: OrderStatus; // created/pending/payed/delivered/prepared/finished/before_pay_closed/after_pay_closed
  deliveryMode: DeliveryMode;
  amount: number;
  details: OrderDetailItem[];
  activityName: string;
  activityTel: string;
}

interface SelfPickInfo {
  address: string;
  linkman: string;
  tel: string;
  code?: string;
}

export interface Order extends OrderExt {
  userId: string;
  userOpenId: string;
  storeId?: string;
  distributorId?: string;
  distributorUserId?: string;
  spokesmanId: string;
  spokesmanUserId: string;
  remark: string;
  paymentDeadlineAt: number;
  cancelled?: number;
  cancelReason?: string;
  finished?: number;
  afterSaleDeadlineAt?: number;
  shippingAddress: StringIndexer;
  shippingFee: number;
  productAmount: number;
  actualAmount: number;
  isApplyForAfterSale: boolean;
  isInAfterSale: boolean;
  payType: string; // 目前只有wxpay
  selfPickInfo?: SelfPickInfo;
  deliverInfo?: LogisticsInfo;
  brandName: string;
  brandPic: string;
  brandTel: string;
  storeName?: string;
  storePic?: string;
  storeTel?: string;
  activityOwner: ActivityOwner;
  parentActivityOwner?: ActivityOwner;
  parentActivityName?: string;
  parentActivityTel?: string;
  buyerNickName: string;
  buyerPic: string;
  buyerTel: string;
}

export interface TransactionInfo {
  timeStamp: string;
  nonce: string;
  package: string;
  signType: string;
  paySign: string;
}

export interface enforcement {
  delivered: number;
  received: number;
  prepared: number;
  picked: number;
  pickupCode: string;
  shippingLogisticsInfo: StringIndexer;
}

export interface PlaceOrderDetailItem {
  storageKey: string;
  productId: string;
  productSpecId?: string;
  quantity: number;
  price: number;
}

export interface PlaceOrderParams {
  brandId: string;
  activityId: string;
  userId: string;
  userOpenId: string;
  shareUserId?: string;
  deliveryMode: DeliveryMode;
  remark?: string;
  shippingAddress: StringIndexer;
  shippingFee: number;
  productAmount: number;
  amount: number;
  warehouseId: string;
  details: PlaceOrderDetailItem[];
  awardId?: string;
}

export interface PlaceOrderResult {
  order: Order;
  transactionInfo: TransactionInfo;
}

export interface RepayOrderParams {
  orderSerialNumber: string;
  userId: string;
}

export interface CancelOrderParams {
  orderSerialNumber: string;
  userId: string;
  cancelReason?: string;
}

export interface PrepareOrderParams {
  orderSerialNumber: string;
  brandId: string;
}

export interface PickOrderByBParams {
  orderSerialNumber: string;
  pickupCode: string;
  brandId: string;
}

export interface PickOrderByCParams {
  orderSerialNumber: string;
  userId: string;
}

export interface DeliverOrderParams {
  orderSerialNumber: string;
  brandId: string;
  platform: number;
  platformOrderNum: string;
}

export interface ReceiveOrderParams {
  orderSerialNumber: string;
  userId: string;
}

export interface OrderItemForC extends OrderExt {
  storeId?: string;
  distributorId?: string;
  distributorUserId?: string;
  paymentDeadlineAt: number;
  ownerName: string;
  ownerPic: string;
  ownerTel: string;
}

export interface OrderItemForS extends OrderExt {
  storeId?: string;
  distributorId?: string;
  distributorUserId?: string;
  spokesmanId: string;
  spokesmanUserId: string;
  ownerName: string;
  ownerPic: string;
  ownerTel: string;
  buyerNickName: string;
  buyerPic: string;
}

export interface OrderItemForB extends OrderExt {
  buyerNickName: string;
  buyerPic: string;
  isApplyForAfterSale: boolean;
  isInAfterSale: boolean;
  brandName: string;
  brandPic: string;
  brandTel: string;
}

export interface OrderItemForStore extends OrderExt {
  storeId: string;
  distributorId: string;
  distributorUserId: string;
  buyerNickName: string;
  buyerPic: string;
  isApplyForAfterSale: boolean;
  isInAfterSale: boolean;
  storeName: string;
  storePic: string;
  storeTel: string;
}

/****************************************************************************************/
/*                                   after_sale                                         */
/****************************************************************************************/

export interface AfterSaleSlimDetailItem {
  productId: string;
  productName: string;
  productSpecId: string;
  productSpecKey: string;
  productSpecName: string;
  productWithSpecName: string;
  storageKey: string;
  productPics: string[];
  quantity: number;
  price: number;
}

export interface AfterSaleDetailItem extends AfterSaleSlimDetailItem {
  afterSaleDetailId: string;
  goodsReceivingStatus: GoodsReceivingStatus;
}

interface AfterSaleExt {
  afterSaleId: string;
  applied: number;
  serialNumber: string;
  brandId: string;
  activityId: string;
  afterSaleStatus: AfterSaleStatus;
  amount: number;
  type: AfterSaleType;
  closeReason?: AfterSaleCloseReason;
  brandName: string;
  brandPic: string;
  brandTel: string;
  activityName: string;
  activityTel: string;
}

export interface AfterSale extends AfterSaleExt {
  orderId: string;
  orderSerialNumber: string;
  userId: string;
  storeId?: string;
  distributorId?: string;
  distributorUserId?: string;
  spokesmanId?: string;
  spokesmanUserId?: string;
  audited?: number;
  cancelled?: number;
  sended?: number;
  received?: number;
  refunded?: number;
  remark?: string;
  isWholeRefund: boolean;
  afterSaleReason: string;
  refuseAfterSaleReason?: string;
  returnGoodsAddressInfo: StringIndexer;
  returnGoodsLogisticsInfo?: StringIndexer;
  details: AfterSaleDetailItem[];
  storeName?: string;
  storePic?: string;
  storeTel?: string;
  activityOwner: ActivityOwner;
  parentActivityOwner?: ActivityOwner;
  parentActivityName?: string;
  parentActivityTel?: string;
  buyerNickName: string;
  buyerPic: string;
  buyerTel: string;
}

export interface AfterSaleItemForC extends AfterSaleExt {
  details: AfterSaleSlimDetailItem[];
}

export interface AfterSaleItemForS extends AfterSaleExt {
  spokesmanId?: string;
  spokesmanUserId?: string;
  details: AfterSaleSlimDetailItem[];
  buyerNickName: string;
  buyerPic: string;
}

export interface AfterSaleItemForB extends AfterSaleExt {
  details: AfterSaleSlimDetailItem[];
  buyerNickName: string;
  buyerPic: string;
}

export interface AfterSaleItemForStore extends AfterSaleExt {
  storeId?: string;
  distributorId?: string;
  distributorUserId?: string;
  details: AfterSaleSlimDetailItem[];
  storeName: string;
  storePic: string;
  storeTel: string;
  buyerNickName: string;
  buyerPic: string;
}

export interface ApplyAfterSaleDetailItem {
  orderDetailId: string;
  quantity: number;
  goodsReceivingStatus: GoodsReceivingStatus;
}

export interface ApplyAfterSaleParams {
  userId: string;
  orderSerialNumber: string;
  type: AfterSaleType;
  afterSaleReason: string;
  remark?: string;
  details: ApplyAfterSaleDetailItem[];
}

export interface CancelAfterSaleParams {
  afterSaleSerialNumber: string;
  userId: string;
}

export interface AuditAfterSaleParams {
  afterSaleSerialNumber: string;
  brandId: string;
  isRefuse: boolean;
  refuseReason?: string;
}

export interface SendAfterSaleReturnGoodsParams {
  afterSaleSerialNumber: string;
  userId: string;
  platformId: string;
  platformName: string;
  platformNo: string;
}

export interface ReceiveAfterSaleReturnGoodsRarams {
  afterSaleSerialNumber: string;
  brandId: string;
  agreeReceive: boolean;
  refuseAfterSaleReason?: string;
}
